﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FJERP.Model;
using FJERP.DAL;
using System.Data.SqlClient;
using System.Data;

namespace FJERP.BLL
{
   public class ProductBLL
    {

        ProductDAL dal = new ProductDAL();//实例化DAL
        /// <summary>
        /// 商品列表显示
        /// </summary>
        /// <returns></returns>
        public List<Product> Product_show(int PageSize, int PageIndex)
        {
            return dal.Product_show(PageSize, PageIndex);
        }
        /// <summary>
        /// 商品总数量
        /// </summary>
        /// <returns></returns>
        public int Product_Count()
        {
            return dal.Product_Count();
        }
        /// <summary>
        /// 删除供应商
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Del(int id)
        {
            return dal.Del(id);
        }
        /// <summary>
        /// 根据Id的获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable Product_Hu(int id)
        {
            return dal.Product_Hu(id);

        }
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public int UptProduct(Product s)
        {
            return dal.UptProduct(s);
        }
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public int AddProduct(Product s)
        {
            return dal.AddProduct(s);
        }
        /// <summary>
        /// 类型显示
        /// </summary>
        /// <returns></returns>
        public DataTable Product_Type_Show()
        {
            return dal.Product_Type_Show();
        }
        /// <summary>
        /// 商品列表显示查询
        /// </summary>
        /// <returns></returns>
        public List<Product> Product_show_Sel(int PageSize, int PageIndex, string Product_Name, string Product_Modelspe, int? Product_Type_Id)
        {
            return dal.Product_show_Sel(PageSize, PageIndex, Product_Name, Product_Modelspe, Product_Type_Id);
        }
        public string GetRandom1()
        {
            return dal.GetRandom1();
        }
        public string GetRandom2()
        {
            return dal.GetRandom2();
        }

        public string GetRandom3()
        {
            return dal.GetRandom3();
        }
    }
}
